package cyce.dfs.fileChooser;

import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.*;
import javax.swing.tree.TreeSelectionModel;

public class FileChooser extends JPanel {

	private FileModel model;
	private JTree jTree;

	public FileChooser(FileModel model) {
		super();
		
		this.model = model;
		this.jTree = new JTree(this.model.getTreeModel());

		this.layoutView();
	}
	
	
	private void layoutView()
	{
		this.setPreferredSize(new Dimension(200, 400));
		this.jTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
		this.jTree.setEditable(true);

		JScrollPane scroller = new JScrollPane(this.jTree, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		scroller.setPreferredSize(new Dimension(200, 400));
		this.add(scroller);
	}

}
